package com.company;

import java.util.Arrays;

public class Solution1470 {
    public static int[] shuffle(int[] nums, int n) {
        int[] ans=new int[2*n];
        for (int k=0,i=0,j=n;k<2*n;k++)
        {
            ans[k]=k%2==0?nums[i++]:nums[j++];
        }
        return ans;
    }

    public static void main(String[] args) {
        int[] nums={2,5,1,3,4,7};
        int n=3;
        System.out.println(Arrays.toString(shuffle(nums, n)));
    }
}
